import VueRouter from 'vue-router';

//导入路由组件
import HomeContainer from './components/tabber/HomeContainer.vue';
import MemberContainer from './components/tabber/MemberContainer.vue';
import ShopcarContainer from './components/tabber/ShopcarContainer.vue';
import SearchContainer from './components/tabber/SearchContainer.vue';
import NewsList from './components/news/NewsList.vue';
import NewsInfo from './components/news/NewsInfo.vue';
import PhotoList from './components/photos/PhotoList.vue';
import GoodsList from './components/goods/GoodsList.vue'
import GoodsInfo from './components/goods/GoodsInfo.vue'
import GoodsComment from './components/goods/GoodsComment.vue'
import GoodsDesc from './components/goods/GoodsDesc.vue'

//创建路由对象
var router = new VueRouter({
    routes: [   //设置路由规则
        {path: '/', redirect: '/home'},
        {path: '/home', component: HomeContainer},
        {path: '/member', component: MemberContainer},
        {path: '/shopcar', component: ShopcarContainer},
        {path: '/search', component: SearchContainer},
        {path: '/home/newsList', component: NewsList},
        {path: '/home/newsInfo/:id', component: NewsInfo},
        {path: '/home/photoList', component: PhotoList},
        {path: '/home/goodsList', component: GoodsList},
        {path: '/home/goodsInfo/:id', component: GoodsInfo, name: 'goodsInfo'},
        {path: '/home/goodsComment/:id', component: GoodsComment},
        {path: '/home/goodsDesc/:id', component: GoodsDesc}
    ],
    linkActiveClass: 'mui-active'   //覆盖默认路由高亮类 router-link-active
});

//向外暴露路由对象
export default router;